package com.Ajava1704.for定时线程池的使用;

import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

/**
 * 作者: LCG
 * 日期: 2020/2/11 09:49
 * 描述:
 */
public class ForConnectionUtils {

    private static ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(1);

    //重试方法
    public static void forConnectionTry(){

        ForConnRunable forConnRunable = new ForConnRunable(scheduledExecutorService);
        scheduledExecutorService.scheduleWithFixedDelay(forConnRunable,0,3,TimeUnit.SECONDS);

    }

}
